/*
 * @Author: your name
 * @Date: 2021-02-24 14:53:25
 * @LastEditTime: 2021-02-24 15:16:43
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \mongoShell\insert2.js
 */
var startTime = (new Date()).getTime();
var db = connect('log'); //选择一个数据库,相当于使用 use 数据库

var tempArray = [];   //声明一个数组
for(let i = 0;i<1000;i++){
    tempArray.push({num:i});
}
db.test2.insert(tempArray);//批量一次插入

var runtime = (new Date()).getTime() - startTime;
print('This run this is: '+runtime + 'ms')
